# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5)

set(can_use_assembler TRUE)
enable_language(ASM)
IF("${OHOS_ARCH}" STREQUAL "arm64-v8a")
 SET(ASM_OPTIONS "-x assembler-with-cpp")
 SET(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS} -march=armv8+crypto -D__OHOS__")
ENDIF()

project(boundscheck)

set(TARGET_BOUNDSCHECK_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party_bounds_checking_function/src)  # 修正变量名拼写

add_library(boundscheck
            STATIC
            ${TARGET_BOUNDSCHECK_SRC_PATH}/memcpy_s.c  # 使用修正后的变量名
            ${TARGET_BOUNDSCHECK_SRC_PATH}/memset_s.c
            ${TARGET_BOUNDSCHECK_SRC_PATH}/securecutil.c)

include_directories(${TARGET_BOUNDSCHECK_SRC_PATH}  # 修正变量名拼写
                    ${CMAKE_CURRENT_SOURCE_DIR}/third_party_bounds_checking_function/include
                    )

target_link_libraries(boundscheck)
